package com.whc.controller;

import com.whc.service.ShellService;
import lombok.AllArgsConstructor;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author wang-hai-cheng
 * @since 2021/12/11 12:54
 */
@RestController
@AllArgsConstructor
public class ExecutorController {
    ShellService shellService;

    @RequestMapping("exec")
    public ResponseEntity<?> exec(String code) {
        return ResponseEntity.ok(shellService.exec(code));
    }
}